<template>
    <div class="tqydqjltj">
        <!-- 表一 -->
        <el-row class="echartBox">
            <el-card>
                <div style="width: 100%; height:  300px;" id="JLTQB"></div>
            </el-card>
        </el-row>
         <!-- 表二 -->
        <el-row class="echartBox">
            <el-card>
                <div style="width: 100%; height:  300px;" id="FZTQB"></div>
            </el-card>
        </el-row>
         <!-- 表三 -->
        <el-row class="echartBox">
            <el-card>
                <div style="width: 100%; height: 300px;" id="XJYTQB"></div> 
            </el-card>
        </el-row>
        <!-- 联络员建设列表弹出层 -->
        <el-dialog :title="LLYTitle" :visible.sync="LLYDialogTable" class="LLYTitle">
            <el-table :data="LLYData" border height="300">
                <el-table-column type="index" label="序号" min-width="20" align="center"></el-table-column>
                <el-table-column property="name" label="姓名" min-width="50" align="center"></el-table-column>
                <el-table-column property="monthP" label="本月发展新人数" min-width="100" align="center"></el-table-column>
                <el-table-column property="monthPA" label="本年度累积发展新人数" min-width="100" align="center"></el-table-column>
                <el-table-column property="yearM" label="本年度累积发新人献浆数" min-width="100" align="center"></el-table-column>
                <el-table-column property="yearMFrequency" label="本年度累积发新人的献浆频次" min-width="100" align="center"></el-table-column>
            </el-table>
        </el-dialog>
    </div>
</template>
<script>
import analysisHttp from "plugins/axios/analysisHttp.js";
import { Loading, Table } from 'element-ui';
let loadingInstance;
 function loadingIn(){   //开始加载
      loadingInstance = Loading.service({ fullscreen: true})
      setTimeout(() => {
        loadingInstance.close()
      },5000)
    }
    function loadingClose(){ //关闭加载
      loadingInstance.close()
    }

let date = new Date(),y = date.getFullYear(),m = date.getDate() === 1 ? date.getMonth() - 1 : date.getMonth(),
dataZoomEnd = 100 / 12 * m,category = ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'], grid = {left: 50, right: 40},
xAxis = {
    type: 'category',
    data: category,
    splitLine: {show: false},
    axisLine: {lineStyle: {color: '#000'}}
};

export default {
    data(){
        return{
            value:'',
            JLTQBdata:Object, //浆量同期比
            FZTQBData:Object,//反站浆员与量同期比
            XJYTQBData:Object, //新浆员同期比

            //联络员弹框
            LLYDialogTable:false, 
            LLYTitle:'',
            LLYData:[
                {name:'高同中',monthP:'2',monthPA:'6',yearM:'4',yearMFrequency:'55'},
            ]
        }
    },
    mounted(){
        let that = this
        that.init()
    },
    methods:{
        init(){ //初始化
            let that = this
            ,myChart1 =this.$echarts.init(document.querySelectorAll('#JLTQB')[0])
            ,myChart2 =this.$echarts.init(document.querySelectorAll('#FZTQB')[0])
            ,myChart3 =this.$echarts.init(document.querySelectorAll('#XJYTQB')[0])
            that.getPulpWeight(myChart1)
            that.getFrequencyCount(myChart2)
            that.getNewAndOutProviderCount(myChart3)
            this.$echarts.connect([myChart1, myChart2, myChart3]);
        },
        JLTQB(myChartId){ //浆量同期比
                // ,item ={'2016CreateDate0': 141,'2016CreateDate1': 91,'2016TotalPulp0': 3158,'2016TotalPulp1': 5569,'2016YearPulp0': 3158,'2016YearPulp1': 2411,'2016otherCreateDate0': 3017,'2016otherCreateDate1': 2320,'2017Create0Date0': 102,'2017Create0Date1': 128,'2017Create1Date0': 362,'2017Create1Date1': 309,'2017TotalPulp0': 3118,'2017TotalPulp1': 6263,'2017YearPulp0': 3118,'2017YearPulp1': 3145,'2017otherCreateDate0': 2654,'2017otherCreateDate1': 2708,'2018Create0Date0': 154,'2018Create0Date1': 265,'2018Create1Date0': 404,'2018Create1Date1': 369,'2018Create2Date0': 283,'2018Create2Date1': 271,'2018TotalPulp0': 3531,'2018TotalPulp1': 6873,'2018YearPulp0': 3531,'2018YearPulp1': 3342,'2018otherCreateDate0': 2690,'2018otherCreateDate1': 2437,'2019Create0Date0': 279,'2019Create0Date1': 179,'2019Create1Date0': 491,'2019Create1Date1': 248,'2019Create2Date0': 265,'2019Create2Date1': 164,'2019Create3Date0': 274,'2019Create3Date1': 196,'2019TotalPulp0': 3864,'2019TotalPulp1': 6549,'2019YearPulp0': 3864,'2019YearPulp1': 2685,'2019otherCreateDate0': 2555,'2019otherCreateDate1': 1898}
            // y='2018'
            let that = this,yearA=y-1,yearAA=y-2
            ,collCountGroupByMonth=[],datas = {}
            ,selected1= {},numberCCGY=[],selected1Data=[],selected2={[yearAA+'年之前建档的浆量']:true},selected2Data=[{name:yearAA+'年之前建档的浆量',icon: 'circle'}];
            let data = that.JLTQBdata //获取数据
            for(let i in data.collCountGroupByYear){
                selected1[i+'年浆量'] = false
                selected2[i+'年建档的浆量'] = true
                selected1Data.push({name:i+'年浆量',icon:'circle'}) 
                selected2Data.push({name:i+'年建档的浆量',icon:'circle'})
                numberCCGY.push({NAME:i,num:data.collCountGroupByYear[i]})
            }

            // yearAA(2017)年之前建档在之后献浆
            function CreateYA(_yearAf){
                let arrOC = []
                for(let i in data.countMonthYear){
                    let _y = data.countMonthYear[i].createYear
                    let collCount = data.countMonthYear[i].collCount
                    let allDate=data.countMonthYear[i].allDate
                    if(_y < _yearAf){
                        arrOC.push(collCount)
                    }
                }
                return arrOC
            }
            let alterDataYearAAA = that.alterData(CreateYA(yearAA,'after'),12)
            datas['otherCreate'+yearAA] = alterDataYearAAA[0]//yearAA(2017)年之前建档在yearAA
            datas['otherCreate'+yearA] = alterDataYearAAA[1]//yearAA(2017)年之前建档在yearA
            datas['otherCreate'+y] = alterDataYearAAA[2]//yearAA(2017)年之前建档在y
            function CreateY(_yearAf){
                let arrOC = []
                for(let i in data.countMonthYear){
                    let _y = data.countMonthYear[i].createYear
                    let collCount = data.countMonthYear[i].collCount
                    let allDate=data.countMonthYear[i].allDate
                    if(_y == _yearAf && ((_y.split('-'))[0] >= _yearAf)){
                        arrOC.push(collCount)
                    }
                }
                return arrOC
            }
            let alterDataYearAA = that.alterData(CreateY(yearAA),12)
            datas[yearAA+'Create'+yearAA] = alterDataYearAA[0]//yearAA(2017)年建档在yearAA
            datas[yearAA+'Create'+yearA] = alterDataYearAA[1]//yearAA(2017)年建档在yearA
            datas[yearAA+'Create'+y] = alterDataYearAA[2]//yearAA(2017)年建档在y

            let alterDataYearA = that.alterData(CreateY(yearA),12)
            datas[yearA+'Create'+yearA] = alterDataYearA[0]//yearA(2018)年建档在yearA
            datas[yearA+'Create'+y] = alterDataYearA[1]//yearA(2018)年建档在y

            let alterDataYearY = that.alterData(CreateY(y),12)
            datas[y+'Create'+y] = alterDataYearA[0]//y(2019)年建档在y
            // console.log(11,alterDataYearY)



            //每月浆量yearPulp
             function yearPulpY(){
                let arrOC = []
                for(let i in data.collCountGroupByMonth){
                    let collC = data.collCountGroupByMonth[i]
                    arrOC.push(collC)
                }
                return arrOC
            }
             let alterDataYearPulp = that.alterData(yearPulpY(),12)
             datas['yearPulp'+yearAA] = alterDataYearPulp[0]
             datas['yearPulp'+yearA] = alterDataYearPulp[1]
             datas['yearPulp'+y] = alterDataYearPulp[2]


            // 月累积浆量
            datas['totalPulp'+yearAA] = alterDataYearPulp[0]
            datas['totalPulp'+yearA] = alterDataYearPulp[1]
            datas['totalPulp'+y] = alterDataYearPulp[2]
            // console.log(datas)
            var option2 = {
                title: {
                    text: '浆量同期比',
                    textStyle: {
                        color: '#000',
                        fontSize: 15,
                        fontFamily: '微软雅黑'
                    }
                },
                grid: grid,
                tooltip: {
                    backgroundColor: '#fff',
                    borderWidth: 1,
                    borderColor: '#EBEEF5',
                    confine: true,
                    enterable: true,
                    transitionDuration: 0,
                    textStyle: {color: '#000'},
                    triggerOn: 'click',
                    extraCssText: 'box-shadow: 0 0 5px 5px rgba(51, 51, 51, 0.3);',
                    padding: [5, 10],
                    position: function (pos, params, dom, rect, size) {
                        return [pos[0] + 10, pos[1]];
                    },
                    formatter: function (params) {
                            var index = params.dataIndex;
                            return '<p class="tooltipP">' + params.name + '浆量详情表</p>' +
                            '<div><span>'+yearAA+'年度:</span><span style="margin-left:125px;">'+yearA+'年度:</span><span style="margin-left:165px;">'+y+'年度:</span></div>'+
                            '<table class="tooltipTable" cellpadding="0" cellspacing="0">' +
                            '<thead>' +
                            '<tr>' +
                            '<th class="' + (params.seriesIndex === 3 ? 'bg_105' : 'bg_f3d') + '" style="width:auto;">'+yearAA+'年前建档浆量</th>' +
                            '<th class="' + (params.seriesIndex === 4 ? 'bg_105' : 'bg_f3d') + '" style="width:auto;">'+yearAA+'年建档浆量</th>' +
                            '<th class="' + (params.seriesIndex === 0 ? 'bg_105' : 'bg_f3d') + '" style="width:auto;">'+yearAA+'年浆量</th>' +
                            '<th class="bg_f3d" style="width:auto;">'+yearAA+'年当月累计浆量</th>' +

                            '<th class="' + (params.seriesIndex === 5 ? 'bg_105' : 'bg_d9e') + '" style="auto">'+yearAA+'年前建档浆量</th>' +
                            '<th class="' + (params.seriesIndex === 6 ? 'bg_105' : 'bg_d9e') + '" style="auto">'+yearAA+'年建档浆量</th>' +
                            '<th class="' + (params.seriesIndex === 7 ? 'bg_105' : 'bg_d9e') + '" style="auto">'+yearA+'年建档浆量</th>' +
                            '<th class="' + (params.seriesIndex === 1 ? 'bg_105' : 'bg_d9e') + '" style="auto">'+yearA+'年浆量</th>' +
                            '<th class="bg_d9e" style="width:auto;">'+yearA+'年当月累计浆量</th>' +

                            '<th class="' + (params.seriesIndex === 8 ? 'bg_105' : 'bg_f9c') + '" style="auto">'+yearAA+'年前建档浆量</th>' +
                            '<th class="' + (params.seriesIndex === 9 ? 'bg_105' : 'bg_f9c') + '" style="auto">'+yearAA+'年建档浆量</th>' +
                            '<th class="' + (params.seriesIndex === 10 ? 'bg_105' : 'bg_f9c') + '" style="auto">'+yearA+'年建档浆量</th>' +
                            '<th class="' + (params.seriesIndex === 11 ? 'bg_105' : 'bg_f9c') + '" style="auto">'+y+'年建档浆量</th>' +
                            '<th class="' + (params.seriesIndex === 2 ? 'bg_105' : 'bg_f9c') + '" style="auto">'+y+'年浆量</th>' +
                            '<th class="bg_f9c" style="width:auto;">'+y+'年建档浆量</th>' +
                            '</tr>' +
                            '</thead>' +
                            '<tbody>' +
                            '<tr>' +
                            '<td class="' + (params.seriesIndex === 3 ? 'bg_105' : 'bg_f3d') + '" style="width:auto;">' + datas['otherCreate'+yearAA][index] + '</td>' +
                            '<td class="' + (params.seriesIndex === 4 ? 'bg_105' : 'bg_f3d') + '" style="width:auto;">' + datas[yearAA+'Create'+yearAA][index] + '</td>' +
                            '<td class="' + (params.seriesIndex === 0 ? 'bg_105' : 'bg_f3d') + '" style="width:auto;">' + datas['yearPulp'+yearAA][index] + '</td>' +
                            '<td class="bg_f3d" style="width:auto;">' + datas['totalPulp'+yearAA][index] + '</td>' +

                            '<td class="' + (params.seriesIndex === 5 ? 'bg_105' : 'bg_d9e') + '" style="auto">' + datas['otherCreate'+yearA][index] + '</td>' +
                            '<td class="' + (params.seriesIndex === 6 ? 'bg_105' : 'bg_d9e') + '" style="auto">' + datas[yearAA+'Create'+yearA][index] + '</td>' +
                            '<td class="' + (params.seriesIndex === 7 ? 'bg_105' : 'bg_d9e') + '" style="auto">' + datas[yearA+'Create'+yearA][index] + '</td>' +
                            '<td class="' + (params.seriesIndex === 1 ? 'bg_105' : 'bg_d9e') + '" style="auto">' + datas['yearPulp'+yearA][index] + '</td>' +
                            '<td class="bg_d9e" style="auto">' + datas['totalPulp'+yearA][index] + '</td>' +

                            '<td class="' + (params.seriesIndex === 8 ? 'bg_105' : 'bg_f9c') + '" style="auto">' + datas['otherCreate'+y][index] + '</td>' +
                            '<td class="' + (params.seriesIndex === 9 ? 'bg_105' : 'bg_f9c') + '" style="auto">' + datas[yearAA+'Create'+y][index] + '</td>' +
                            '<td class="' + (params.seriesIndex === 10 ? 'bg_105' : 'bg_f9c') + '" style="auto">' + datas[yearA+'Create'+y][index] + '</td>' +
                            '<td class="' + (params.seriesIndex === 11 ? 'bg_105' : 'bg_f9c') + '" style="auto">' + datas[y+'Create'+y][index] + '</td>' +
                            '<td class="' + (params.seriesIndex === 2 ? 'bg_105' : 'bg_f9c') + '" style="auto">' + datas['yearPulp'+y][index] + '</td>' +
                            '<td class="bg_f9c" style="auto">' + datas['totalPulp'+y][index] + '</td>' +
                            '</tr>' +
                            '</tbody>' +
                            '</table>'

                        }
                },
                toolbox: {
                    show: false,
                    feature: {
                        myTool1: {
                            show: true,
                            title: '注解',
                            icon: 'image://images/setting.png',
                            onclick: function () {
                                openAnnotation(1);
                            }
                        }
                    }
                },
                legend: [
                    {
                        type: 'scroll',
                        textStyle: {color: '#000'},
                        itemWidth: 14,
                        pageIconColor: '#000',
                        pageIconInactiveColor: '#000',
                        pageTextStyle: {
                            color: '#000'
                        },
                        top: 0,
                        left: 180,
                        data:selected1Data,
                        selected: selected1,
                        formatter: function (name) {
                            function numB(val){
                                for(let i in numberCCGY){
                                    if(val.indexOf(numberCCGY[i].NAME) >-1){
                                        return val+' ( '+numberCCGY[i].num+' 袋 )'
                                    }
                                }
                            }
                            return numB(name)
                        }       
                    },
                    {
                        type: 'scroll',
                        textStyle: {color: '#000'},
                        itemWidth: 14,
                        pageIconColor: '#000',
                        pageIconInactiveColor: '#000',
                        pageTextStyle: {
                            color: '#000'
                        },
                        top: 22,
                        left: 180,
                        data:selected2Data,
                        selected: selected2
                    }
                ],
                xAxis: xAxis,
                yAxis: {
                    type: 'value',
                    name: '袋',
                    nameGap: 5,
                    splitLine: {
                        show: false
                    },
                    axisLine: {
                        lineStyle: {
                            color: '#000'
                        }
                    }
                },
                dataZoom: [
                    {
                        type: 'slider',
                        filterMode: 'weakFilter',
                        showDataShadow: true,
                        bottom: 20,
                        height: 5,
                        start: 0,
                        end: dataZoomEnd,
                        borderColor: 'transparent',
                        backgroundColor: '#e2e2e2',
                        handleIcon: 'M10.7,11.9H9.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z',
                        handleSize: 15,
                        handleStyle: {
                            shadowBlur: 6,
                            shadowOffsetX: 1,
                            shadowOffsetY: 2,
                            shadowColor: '#000'
                        },
                        labelFormatter: ''
                    },
                    {
                        type: 'inside',
                        filterMode: 'weakFilter'
                    }
                ],
                series: (function () {
                    let data = [],items = [
                    {
                        name: yearAA+'年浆量',
                        stack: yearAA+'总',
                        data: datas['yearPulp'+yearAA],
                        color: '#ffA642'

                    },
                    {
                        name: yearA+'年浆量',
                        stack: yearA+'总',
                        data: datas['yearPulp'+yearA],
                        color: '#3ea5d4'

                    },
                    {
                        name: y+'年浆量',
                        stack: y+'总',
                        data: datas['yearPulp'+y],
                        color: '#82c849'

                    },

                    {
                        name: yearAA+'年之前建档的浆量',
                        stack: yearAA,
                        data: datas['otherCreate'+yearAA],
                        color: '#ff5a77'

                    },
                    {
                        name: yearAA+'年建档的浆量',
                        stack: yearAA,
                        data: datas[yearAA+'Create'+yearAA],
                        color: '#ffA642'

                    },

                    {
                        name: yearAA+'年之前建档的浆量',
                        stack: yearA,
                        data: datas['otherCreate'+yearA],
                        color: '#ff5a77'

                    },
                    {
                        name: yearAA+'年建档的浆量',
                        stack: yearA,
                        data: datas[yearAA+'Create7'+yearA],
                        color: '#ffA642'

                    },
                    {
                        name: yearA+'年建档的浆量',
                        stack: yearA,
                        data: datas[yearA+'Create'+yearA],
                        color: '#3ea5d4'

                    },

                    {
                        name: yearAA+'年之前建档的浆量',
                        stack:y,
                        data: datas['otherCreate'+y],
                        color: '#ff5a77'

                    },
                    {
                        name: yearAA+'年建档的浆量',
                        stack: y,
                        data: datas[yearAA+'Create'+y],
                        color: '#ffA642'

                    },
                    {
                        name: yearA+'年建档的浆量',
                        stack: y,
                        data: datas[yearA+'Create'+y],
                        color: '#3ea5d4'

                    },
                    {
                        name: y+'年建档的浆量',
                        stack: y,
                        data: datas[y+'Create'+y],
                        color: '#82c849'

                    }
                    ];
                    for (var i = 0; i < items.length; i++) {
                        var item = items[i];
                        data.push({
                            name: item.name,
                            type: 'bar',
                            // barWidth: 12,
                            stack: item.stack,
                            data: item.data,
                            barGap: '100%',
                            itemStyle: {
                                normal: {
                                    color: item.color
                                }
                            }
                        });
                    }
                    return data;

                }())
            };
            // let myChart1 = this.$echarts.init(document.querySelectorAll('#JLTQB')[0])
            myChartId.setOption(option2);
            window.addEventListener("resize", () => {
                    myChartId.resize();
                });
        },
        FZTQB(myChartId){ //反站浆员与量同期比
            // y='2018'
            let that = this,items=that.FZTQBData,yearA=y-1,yearAA=y-2
            ,datas={}
            ,selected1= {[yearAA+'年的新浆员']:true},selected2= {[yearA+'年的新浆员']:true},selected3= {[y+'年的新浆员']:true}
            // console.log(items)

            

            //每年每月新浆员反站人数
            function createCountMap(){
                let arr = []
                for(let i in items.createCountMap){
                    arr.push(items.createCountMap[i])
                }
                arr = that.alterData(arr,12)
                return arr
            }
            
            datas['new'+yearAA]= createCountMap()[0] //yearAA年新浆员反站人数
            datas['new'+yearA]= createCountMap()[1]
            datas['new'+y]= createCountMap()[2]
            
            // datas['new'+yearAA] // yearAA年新浆员反站浆量

            // 建档月数(顶部)
            function lastLastYF(item){
                let arr = {}
                for(let i in item){
                    let _month = ++i;
                    arr[yearAA+'年'+_month+'月建档'] = true
                }
                return arr
            }
            selected1= Object.assign(selected1,lastLastYF(createCountMap()[0]))
            selected1= Object.assign(selected2,lastLastYF(createCountMap()[1]))
            selected1= Object.assign(selected3,lastLastYF(createCountMap()[2]))

            //数据(每月人数、浆量)
            function returnlast(item){
                let arr = []
                for(let i in item){
                    arr.push(item[i])
                }
                return arr
            }
            for(let i=0;i<=11;i++){
                datas['returnPulp'+yearAA+'In'+i+'People'] = [] //人数
                datas['returnPulp'+yearA+'In'+i+'People'] = []
                datas['returnPulp'+y+'In'+i+'People'] = []

                datas['returnPulp'+yearAA+'In'+i+'Amount'] = [] //浆量
                datas['returnPulp'+yearA+'In'+i+'Amount'] = []
                datas['returnPulp'+y+'In'+i+'Amount'] = []

                datas['peopleTotal'+yearAA] = [] //月累加浆员
                datas['peopleTotal'+yearA] =  []
                datas['peopleTotal'+y] = []

                datas['amountTotal'+yearAA] = [] //月累加浆量
                datas['amountTotal'+yearA] = []
                datas['amountTotal'+y] = []
            }
            
            for(let i=0;i<=11;i++){
                for(let j in returnlast(items.lastLastYearFrequency)[i]){
                     datas['returnPulp'+yearAA+'In'+i+'People'].push(returnlast(items.lastLastYearFrequency)[i][j].collPCount) 
                     datas['returnPulp'+yearAA+'In'+i+'Amount'].push(returnlast(items.lastLastYearFrequency)[i][j].collCount) 
                }
                for(let j in returnlast(items.lastYearFrequency)[i]){
                     datas['returnPulp'+yearA+'In'+i+'People'].push(returnlast(items.lastYearFrequency)[i][j].collPCount) 
                     datas['returnPulp'+yearA+'In'+i+'Amount'].push(returnlast(items.lastYearFrequency)[i][j].collCount) 
                }
                for(let j in returnlast(items.currentYearFrequency)[i]){
                     datas['returnPulp'+y+'In'+i+'People'].push(returnlast(items.currentYearFrequency)[i][j].collPCount) 
                     datas['returnPulp'+y+'In'+i+'Amount'].push(returnlast(items.currentYearFrequency)[i][j].collCount) 
                }
               
                
            }
            // console.log(datas)
            var option2 = {
                color: [
                    '#37B8D4',
                    '#8AC867',
                    '#6A9BD3'
                ],
                title: {
                    text: '返站浆员与返站浆量同期比',
                    textStyle: {
                        color: '#000',
                        fontSize: 15,
                        fontFamily: '微软雅黑'
                    }
                },
                grid: {left: 50, right: 30},
                tooltip: {
                    backgroundColor: '#fff',
                    borderWidth: 1,
                    borderColor: '#EBEEF5',
                    confine: true,
                    enterable: true,
                    transitionDuration: 0,
                    textStyle: {color: '#000'},
                    triggerOn: 'click',
                    extraCssText: 'box-shadow: 0 0 5px 5px rgba(51, 51, 51, 0.3);',
                    padding: [5, 10],
                    position: function (pos, params, dom, rect, size) {
                        return [pos[0] + 10, pos[1]];
                    },
                    formatter: function (params) {
                        let _month = params.dataIndex +1,_index = params.dataIndex;
                        function accumPorA(_year,name){ //当年月累计浆员人数
                            let len = 0
                            for(let i=0; i<=_index;i++){
                                // len++
                              len  +=parseInt(datas["returnPulp"+_year+"In" + i +name][i])
                            }
                            return len
                        }
                        let _table =   '<p class="tooltipP">' + category[params.dataIndex]+ '浆员返站人数与返站浆量</p>'+ 
                                '<div><span>'+yearAA+'年度:</span><span style="margin-left:170px;">'+yearA+'年度:</span><span style="margin-left:165px;">'+y+'年度:</span></div>'+
                                '<table class="tooltipTable" cellpadding="0" cellspacing="0">'+
                                '<thead>'+
                                '<tr>'+
                                '<th class="' + ((params.seriesIndex >= 3 && params.seriesIndex <= 26 && params.data.name === "人数") ? 'bg_105' : 'bg_f9c') + '" style="width:8.4%;">'+yearAA+'年' + _month + '月新浆员返站人数</th>' +
                                '<th class="' + ((params.seriesIndex >= 3 && params.seriesIndex <= 26 && params.data.name === "人次") ? 'bg_105' : 'bg_f9c') + '" style="width:8.4%;">'+yearAA+'年的' + _month + '月新浆员返站浆量</th>' +
                                '<th class="bg_f9c" style="width:8.4%;">'+(y-2)+'年新浆员返站人数</th>' +
                                '<th class="bg_f9c" style="width:8.4%;">'+(y-2)+'年新浆员返站浆量</th>' +

                                '<th class="' + ((params.seriesIndex >= 27 && params.seriesIndex <= 50 && params.data.name === "人数") ? 'bg_105' : 'bg_f3d') + '" style="width:8.3%;">'+yearA+'年' + _month + '月新浆员返站人数</th>' +
                                '<th class="' + ((params.seriesIndex >= 27 && params.seriesIndex <= 50 && params.data.name === "人次") ? 'bg_105' : 'bg_f3d') + '" style="width:8.3%;">'+yearA+'年的' + _month + '月新浆员返站浆量</th>' +
                                '<th class="bg_f3d" style="width:8.3%;">'+(y-1)+'年新浆员返站人数</th>' +
                                '<th class="bg_f3d" style="width:8.3%;">'+(y-1)+'年新浆员返站浆量</th>' +

                                '<th class="' + ((params.seriesIndex >= 51 && params.seriesIndex <= 74 && params.data.name === "人数") ? 'bg_105' : 'bg_d9e') + '" style="width:8.3%;">'+y+'年' + _month + '月新浆员返站人数</th>' +
                                '<th class="' + ((params.seriesIndex >= 51 && params.seriesIndex <= 74 && params.data.name === "人次") ? 'bg_105' : 'bg_d9e') + '" style="width:8.3%;">'+y+'年的' + _month + '月新浆员返站浆量</th>' +
                                '<th class="bg_d9e" style="width:8.3%;">'+y+'年新浆员返站人数</th>' +
                                '<th class="bg_d9e" style="width:8.3%;">'+y+'年新浆员返站浆量</th>' +
                                '</tr>'+
                                '</thead>'+
                                '<tbody>' +
                                '<tr>'+
                                '<td class="' + ((params.seriesIndex >= 3 && params.seriesIndex <= 26 && params.data.name === "人数") ? 'bg_105' : 'bg_f9c') + '" style="width:8.4%;">' + datas["returnPulp"+yearAA+"In" + _index + "People"][_index] + '</td>' +
                                '<td class="' + ((params.seriesIndex >= 3 && params.seriesIndex <= 26 && params.data.name === "人次") ? 'bg_105' : 'bg_f9c') + '" style="width:8.4%;">' + datas["returnPulp"+yearAA+"In" + _index + "Amount"][_index] + '</td>' +
                                '<td class="bg_f9c" style="width:8.4%;">' + accumPorA(yearAA,"People") + '</td>' +
                                '<td class="bg_f9c" style="width:8.4%;">' + accumPorA(yearAA,"Amount") +'</td>' +
                                
                                '<td class="' + ((params.seriesIndex >= 27 && params.seriesIndex <= 50 && params.data.name === "人数") ? 'bg_105' : 'bg_f3d') + '" style="width:8.3%;">' + datas["returnPulp2017In" + _index + "People"][_index] + '</td>' +
                                '<td class="' + ((params.seriesIndex >= 27 && params.seriesIndex <= 50 && params.data.name === "人次") ? 'bg_105' : 'bg_f3d') + '" style="width:8.3%;">' + datas["returnPulp2017In" + _index + "Amount"][_index] + '</td>' +
                                '<td class="bg_f3d" style="width:8.3%;">' + accumPorA(yearA,"People") + '</td>' +
                                '<td class="bg_f3d" style="width:8.3%;">' + accumPorA(yearA,"Amount") + '</td>' +

                                '<td class="' + ((params.seriesIndex >= 51 && params.seriesIndex <= 74 && params.data.name === "人数") ? 'bg_105' : 'bg_d9e') + '" style="width:8.3%;">' + datas["returnPulp2018In" + _index + "People"][_index] + '</td>' +
                                '<td class="' + ((params.seriesIndex >= 51 && params.seriesIndex <= 74 && params.data.name === "人次") ? 'bg_105' : 'bg_d9e') + '" style="width:8.3%;">' + datas["returnPulp2018In" + _index + "Amount"][_index] + '</td>' +
                                '<td class="bg_d9e" style="width:8.3%;">' + accumPorA(y,"People") + '</td>' +
                                '<td class="bg_d9e" style="width:8.3%;">' + accumPorA(y,"Amount") + '</td>' +
                                '</tr>'
                                '</tbody>' +
                                '</table>'
                            return _table 
                    }
                },
                legend: [
                    {
                        type: 'scroll',
                        textStyle: {color: '#000'},
                        itemWidth: 14,
                        pageIconColor: '#b7b7b7',
                        pageIconInactiveColor: '#b7b7b7',
                        pageTextStyle: {
                            color: '#000'
                        },
                        top: 0,
                        left: 200,
                        right: 50,
                        selected: selected1,
                        data:(function () {
                            var data = [
                                {
                                    name: yearAA+'年的新浆员',
                                    icon: 'circle'
                                }
                            ];
                            for (var i = 0; i < 12; i++) {
                                let _mo = 1+i
                                data.push({
                                    name: yearAA+'年' +_mo+ "月建档",
                                    icon: 'circle'
                                })
                            }
                            return data;
                        }())
                    },
                    {
                        type: 'scroll',
                        textStyle: {color: '#000'},
                        itemWidth: 14,
                        pageIconColor: '#b7b7b7',
                        pageIconInactiveColor: '#b7b7b7',
                        pageTextStyle: {
                            color: '#000'
                        },
                        top: 22,
                        left: 200,
                        right: 50,
                         selected: selected2,
                        data:(function () {
                            var data = [
                                {
                                    name: yearA+'年的新浆员',
                                    icon: 'circle'
                                }
                            ];
                            for (var i = 0; i < 12; i++) {
                                let _mo = 1+i
                                data.push({
                                    name: yearA+'年' +_mo+ "月建档",
                                    icon: 'circle'
                                })
                            }
                            return data;
                        }())
                    },
                    {
                        type: 'scroll',
                        textStyle: {color: '#000'},
                        itemWidth: 14,
                        pageIconColor: '#b7b7b7',
                        pageIconInactiveColor: '#b7b7b7',
                        pageTextStyle: {
                            color: '#000'
                        },
                        top: 44,
                        left: 200,
                        right: 50,
                        selected: selected3,
                        data:(function () {
                            var data = [
                                {
                                    name: y+'年的新浆员',
                                    icon: 'circle'
                                }
                            ];
                            for (var i = 0; i < 12; i++) {
                                let _mo = 1+i
                                data.push({
                                    name: y+'年' +_mo+ "月建档",
                                    icon: 'circle'
                                })
                            }
                            return data;
                        }())
                    }
                ],
                xAxis: xAxis,
                yAxis: {
                    type: 'value',
                    splitLine: {
                        show: false
                    },
                    axisLine: {
                        lineStyle: {
                            color: '#000'
                        }
                    }
                },
                dataZoom: [
                    {
                        type: 'slider',
                        filterMode: 'weakFilter',
                        showDataShadow: true,
                        bottom: 20,
                        height: 5,
                        borderColor: 'transparent',
                        backgroundColor: '#e2e2e2',
                        handleIcon: 'M10.7,11.9H9.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z',
                        handleSize: 15,
                        start: 0,
                        end: dataZoomEnd,
                        handleStyle: {
                            shadowBlur: 6,
                            shadowOffsetX: 1,
                            shadowOffsetY: 2,
                            shadowColor: '#000'
                        },
                        labelFormatter: ''
                    },
                    {
                        type: 'inside',
                        filterMode: 'weakFilter'
                    }
                ],
                series: (function(){
                    let data = []
                    ,items = [
                        { 
                            name: yearAA+'年的新浆员',
                            stack: yearAA,
                            data: datas['new'+yearAA],
                            color: '#ddc21b'
                        },
                        { 
                            name: yearA+'年的新浆员',
                            stack: yearA,
                            data: datas['new'+yearA],
                            color: '#67bfd4'
                        },
                         { 
                            name: y+'年的新浆员',
                            stack: y,
                            data: datas['new'+y],
                            color: '#a8c860'
                        }
                    ]
                    for(let j = yearAA; j <= y; j++){
                        for(let k = 0; k <= 11; k++){
                            items.push({
                                name: j + '年' + (1+k) + "月建档",
                                stack: j + '人数1',
                                // stack:category[k],
                                // barWidth: 8,
                                data: (function () {
                                    let result = [];
                                    let list = datas["returnPulp" + j + "In" + k + "People"];
                                    for (let i = 0; i < list.length; i++) {
                                        result.push({
                                            name: "人数",
                                            //  stack:category[k],
                                            value: list[i]
                                        })
                                    }
                                    // console.log(result)
                                    return result;
                                }()),
                                color: j === (y-2) && k % 2 === 0 ? "#DDC133" :
                                    (j === (y-2) && k % 2 === 1 ? "#ed940c" :
                                        (j === (y-1) && k % 2 === 0 ? "#8FCEEA" :
                                            (j === (y-1) && k % 2 === 1 ? "#5e84ea" :
                                                (j === y && k % 2 === 0 ? "#A8E377" : "#70e355"))))
                            });
                            items.push({
                            name: j + '年' + (1+k) + "月建档",
                            stack: j + '次数1',
                            // barWidth: 8,
                            data: (function () {
                                let result = [];
                                let list = datas["returnPulp" + j + "In" + k + "Amount"];
                                for (let i = 0; i < list.length; i++) {
                                    result.push({
                                        name: "人次",
                                        //  stack:category[k],
                                        value: list[i]
                                    })
                                }
                                return result;
                            }()),
                            color: j === (y-2) && k % 2 === 0 ? "#DDC133" :
                                (j === (y-2) && k % 2 === 1 ? "#ed852b" :
                                    (j === (y-1) && k % 2 === 0 ? "#8FCEEA" :
                                        (j === (y-1) && k % 2 === 1 ? "#5f5eea" :
                                            (j === y && k % 2 === 0 ? "#A8E377" : "#22e35b"))))
                            })
                        }
                    }
                    // console.log(21212,items)
                    for (let i = 0; i < items.length; i++) {
                        let _item = items[i];
                        data.push({
                            name: _item.name,
                            type: 'bar',
                            // barWidth: 12,
                            stack: _item.stack,
                            data: _item.data,
                            barGap: '100%',
                            itemStyle: {
                                normal: {
                                    color: _item.color
                                }
                            }
                        });
                    }
                    // console.log(5555,data)
                    return data;
                })()
            };
            // let myChart2 =that.$echarts.init(document.querySelectorAll('#FZTQB')[0])
            myChartId.setOption(option2);
             window.addEventListener("resize", () => {
                    myChartId.resize();
                });
        },
        XJYTQB(myChartId){ //新浆员同期比
            let that = this
            console.log(that.XJYTQBData)
            let datas={},items=that.XJYTQBData,yearA=y-1,yearAA=y-2

            window.openLiaisonPulp = (res) => {
                that.LLYDialogTable = true
                that.LLYTitle =res+'月联络员建设月表'
                
            }
            let selected1={},selected2={},selected3={}

                    selected1[(y-2)+'年新浆员'] = true;
                    selected1[(y-2)+'年R浆员'] = true;
                    selected1[(y-2)+'年建档未献浆浆员'] = true;
                    selected1[(y-2)+'年净增长浆员'] = false;
                    selected1[(y-2)+'年淘汰浆员'] = false;

                    selected2[(y-1)+'年新浆员'] = true;
                    selected2[(y-1)+'年R浆员'] = true;
                    selected2[(y-1)+'年建档未献浆浆员'] = true;
                    selected2[(y-1)+'年净增长浆员'] = false;
                    selected2[(y-1)+'年淘汰浆员'] = false;

                    selected3[y+'年新浆员'] = true;
                    selected3[y+'年R浆员'] = true;
                    selected3[y+'年建档未献浆浆员'] = true;
                    selected3[y+'年净增长浆员'] = false;
                    selected3[y+'年淘汰浆员'] = false;

                    for(let i=yearAA;i<=y;i++){ //数组初始化
                        datas['netGrowth'+i] = [];datas['netGrowthNd'+i] = [];datas['outProvider'+i] = [];datas['outProviderNd'+i] = []
                        ;datas['allProvider'+i] = [];datas['newP'+i] = [];datas['RP'+i] = [];datas['notP'+i] = [];datas['totalPulps'+i] = [];
                    }

                     function createCountMap(item){ //对象转二维数组(正常情况)
                        let arr = []
                        for(let i in item){
                            arr.push(item[i])
                        }
                        arr = that.alterData(arr,12)
                        return arr
                    }
                    
                    function NBCM(){ //对象转二维数组(非正常情况)
                        let _arr=[]
                        function toM(val){
                            return val <= 9 ? '0'+val : val
                        }
                        for(let i=1; i<=3;i++){
                            for(let j=1 ; j <= 12 ;j++){
                                let nian = i==1?y-2:i==2?y-1:i==3?y:y;
                                _arr.push(items.netBoostCountMonth[nian+'-'+toM(j)])
                            }
                        }
                        _arr = that.alterData(_arr,12)
                        return _arr
                    }

                    //每年每月新浆员反站人数
                   
                    datas['newP'+yearAA] =  createCountMap(items.createCountMonth)[0]
                    datas['newP'+yearA] =  createCountMap(items.createCountMonth)[1]
                    datas['newP'+y] =  createCountMap(items.createCountMonth)[2]

                    //每年每月净增长
                    datas['netGrowth'+yearAA] = NBCM()[0]
                    datas['netGrowth'+yearA] = NBCM()[1]
                    datas['netGrowth'+y] = NBCM()[2]

                    //每年每月的淘汰浆员人数 
                     datas['outProvider'+yearAA] = createCountMap(items.outProviderCountMonth)[0]
                     datas['outProvider'+yearA] = createCountMap(items.outProviderCountMonth)[1]

                     datas['outProvider'+y] = createCountMap(items.outProviderCountMonth)[2]

                    // 每年每月的 R 浆员人数
                    datas['RP'+yearAA] = createCountMap(items.createRCountMonth)[0]
                    datas['RP'+yearA] = createCountMap(items.createRCountMonth)[1]
                    datas['RP'+y] = createCountMap(items.createRCountMonth)[2]

                    //建档未献浆浆员
                    datas['notP'+yearAA] = createCountMap(items.createNotComeCountMonth)[0]
                    datas['notP'+yearA] = createCountMap(items.createNotComeCountMonth)[1]
                    datas['notP'+y] = createCountMap(items.createNotComeCountMonth)[2]


                    console.log(datas)
                    let option1 = {
                        title: {
                            text: '新浆员同期比',
                            textStyle: {
                                color: "#000",
                                fontSize: 15,
                                fontFamily: '微软雅黑'
                            }
                        },
                        grid: grid,
                        tooltip: {
                            backgroundColor: '#fff',
                            borderWidth: 1,
                            borderColor: '#EBEEF5',
                            confine: true,
                            enterable: true,
                            transitionDuration: 0,
                            textStyle: {color: '#000'},
                            triggerOn: 'click',
                            extraCssText: 'box-shadow: 0 0 5px 5px rgba(51, 51, 51, 0.3);',
                            padding: [5, 10],
                            formatter: function (params) {
                                let _index = params.dataIndex
                                return '<p class="tooltipP">' + params.name + '浆员详情表</p>' +
                                    '<div><span>'+yearAA+'年度:</span><span style="margin-left:200px;">'+yearA+'年度:</span><span style="margin-left:195px;">'+y+'年度:</span></div>'+
                                    '<table class="tooltipTable" cellpadding="0" cellspacing="0">' +
                                    '<thead>' +
                                    '<tr>' +
                                    '<th class="' + (params.seriesIndex === 0 ? 'bg_105' : 'bg_f9c') + '" style="width:6.25%;">'+(y-2)+'年本月新浆员</th>' +
                                    '<th class="' + (params.seriesIndex === 1 ? 'bg_105' : 'bg_f9c') + '" style="width:6.25%;">'+(y-1)+'年本月新浆员</th>' +
                                    '<th class="cursor ' + (params.seriesIndex === 2 ? 'bg_105' : 'bg_f9c') + '" style="width:6.25%;">'+y+'年本月新浆员</th>' +
                                    '<th class="' + (params.seriesIndex === 6 ? 'bg_105' : 'bg_f3d') + '" style="width:6.25%;">'+(y-2)+'年本月R浆员</th>' +
                                    '<th class="' + (params.seriesIndex === 7 ? 'bg_105' : 'bg_f3d') + '" style="width:6.25%;">'+(y-1)+'年本月R浆员</th>' +
                                    '<th class="' + (params.seriesIndex === 8 ? 'bg_105' : 'bg_f3d') + '" style="width:6.25%;">'+y+'年本月R浆员</th>' +
                                    '<th class="' + (params.seriesIndex === 3 ? 'bg_105' : 'bg_d9e') + '" style="width:6.25%;">'+(y-2)+'年本月建档未献浆浆员</th>' +
                                    '<th class="' + (params.seriesIndex === 4 ? 'bg_105' : 'bg_d9e') + '" style="width:6.25%;">'+(y-1)+'年本月建档未献浆浆员</th>' +
                                    '<th class="' + (params.seriesIndex === 5 ? 'bg_105' : 'bg_d9e') + '" style="width:6.25%;">'+y+'年本月建档未献浆浆员</th>' +
                                    '<th class="' + (params.seriesIndex === 3 ? 'bg_105' : 'bg_d1c') + '" style="width:6.25%;">'+(y-2)+'年本月淘汰浆员</th>' +
                                    '<th class="' + (params.seriesIndex === 3 ? 'bg_105' : 'bg_d1c') + '" style="width:6.25%;">'+(y-1)+'年本月淘汰浆员</th>' +
                                    '<th class="' + (params.seriesIndex === 3 ? 'bg_105' : 'bg_d1c') + '" style="width:6.25%;">'+y+'年本月淘汰浆员</th>' +
                                    '<th class="' + (params.seriesIndex === 9 ? 'bg_105' : 'bg_f9c') + '" style="width:6.25%;">'+(y-2)+'年本月净增长浆员</th>' +
                                    '<th class="' + (params.seriesIndex === 10 ? 'bg_105' : 'bg_f9c') + '" style="width:6.25%;">'+(y-1)+'年本月净增长浆员</th>' +
                                    '<th class="' + (params.seriesIndex === 11 ? 'bg_105' : 'bg_f9c') + '" style="width:6.25%;">'+y+'年本月净增长浆员</th>' +

                                    '<th class="bg_f3d" style="width:6.25%;">'+y+'年本月在册浆员</th>' +
                                    '</tr>' +
                                    '</thead>' +
                                    '<tbody>' +
                                    '<tr>' +

                                    '<td class="' + (params.seriesIndex === 0 ? 'bg_105' : 'bg_f9c') + '" style="width:6.25%;">' + datas['newP'+yearAA][_index] + '</th>' +
                                    '<td class="' + (params.seriesIndex === 1 ? 'bg_105' : 'bg_f9c') + '" style="width:6.25%;">' + datas['newP'+yearA][_index] + '</td>' +
                                    '<td class="cursor ' + (params.seriesIndex === 2 ? 'bg_105' : 'bg_f9c') + '" style="width:6.25%;"><span onclick="openLiaisonPulp(\'' + (_index + 1) + '\')">' + datas['newP'+y][_index]  + '</span></td>' +
                                    '<td class="' + (params.seriesIndex === 6 ? 'bg_105' : 'bg_f3d') + '" style="width:6.25%;">' + datas['RP'+yearAA][_index] + '</td>' +
                                    '<td class="' + (params.seriesIndex === 7 ? 'bg_105' : 'bg_f3d') + '" style="width:6.25%;">' + datas['RP'+yearA][_index] + '</td>' +
                                    '<td class="' + (params.seriesIndex === 8 ? 'bg_105' : 'bg_f3d') + '" style="width:6.25%;">' + datas['RP'+y][_index] + '</td>' +
                                    '<td class="' + (params.seriesIndex === 3 ? 'bg_105' : 'bg_d9e') + '" style="width:6.25%;">' + datas['notP'+yearAA][_index] + '</td>' +
                                    '<td class="' + (params.seriesIndex === 4 ? 'bg_105' : 'bg_d9e') + '" style="width:6.25%;">' + datas['notP'+yearA][_index] + '</td>' +
                                    '<td class="' + (params.seriesIndex === 5 ? 'bg_105' : 'bg_d9e') + '" style="width:6.25%;">' + datas['notP'+y][_index] + '</td>' +
                                    '<td class="' + (params.seriesIndex === 3 ? 'bg_105' : 'bg_d1c') + '" style="width:6.25%;">' + datas['outProvider'+yearAA][_index] + '</td>' +
                                    '<td class="' + (params.seriesIndex === 3 ? 'bg_105' : 'bg_d1c') + '" style="width:6.25%;">' + datas['outProvider'+yearA][_index] + '</td>' +
                                    '<td class="' + (params.seriesIndex === 3 ? 'bg_105' : 'bg_d1c') + '" style="width:6.25%;">' + datas['outProvider'+y][_index] + '</td>' +
                                    '<td class="' + (params.seriesIndex === 9 ? 'bg_105' : 'bg_f9c') + '" style="width:6.25%;">' + (datas['netGrowth'+yearAA][_index]<=0?0:datas['netGrowth'+yearAA][_index]) + '</td>' +
                                    '<td class="' + (params.seriesIndex === 10 ? 'bg_105' : 'bg_f9c') + '" style="width:6.25%;">' + (datas['netGrowth'+yearA][_index]<=0?0:datas['netGrowth'+yearA][_index]) + '</td>' +
                                    '<td class="' + (params.seriesIndex === 11 ? 'bg_105' : 'bg_f9c') + '" style="width:6.25%;">' + (datas['netGrowth'+y][_index]<=0?0:datas['netGrowth'+y][_index])  + '</td>' +
                                    '<td class="bg_f3d" style="width:6.25%;">' + 0 + '</td>' +
                                    '</tr>' +
                                    '</tbody>' +
                                    '</table>'
                            }
                        },
                        legend: [
                            {
                                type: 'scroll',
                                textStyle: {color: '#000'},
                                itemWidth: 14,
                                pageIconColor: '#b7b7b7',
                                pageIconInactiveColor: '#b7b7b7',
                                pageTextStyle: {
                                    color: '#000'
                                },
                                top: 0,
                                left: 160,
                                data: [
                                    {
                                        name: (y-2)+'年新浆员',
                                        icon: 'circle'
                                    },
                                    {
                                        name: (y-2)+'年R浆员',
                                        icon: 'circle'
                                    },
                                    {
                                        name: (y-2)+'年建档未献浆浆员',
                                        icon: 'circle'
                                    },
                                    {
                                        name: (y-2)+'年净增长浆员',
                                        icon: 'circle'
                                    },
                                    {
                                        name: (y-2)+'年淘汰浆员',
                                        icon: 'circle'
                                    }
                                ],
                                selected: selected1,
                                formatter: function (name) {
                                    if (name == (yearAA+'年净增长浆员') ) {
                                       name = yearAA+'年累积净增长浆员总人数' + ' ( '+items.netBoostCountYear[yearAA]+' 人 )'
                                    } else if (name == (yearAA+'年淘汰浆员') ) {
                                       name = yearAA+'年累积淘汰浆员总人数' + ' ( '+items.outProviderCountYear[yearAA]+' 人 )'
                                    } else if (name === (yearAA+'年新浆员') ) {
                                      name = yearAA+'年累积新浆员总人数' + ' ( '+items.createCountYear[yearAA]+' 人 )'
                                    } else if (name == (yearAA+'年R浆员') ) {
                                       name = yearAA+'年累积R浆员总人数' + ' ( '+items.createRCountYear[yearAA]+' 人 )'
                                    } else if (name == (yearAA+'年建档未献浆浆员') ) {
                                        name = yearAA+'年累积建档未献浆浆员总人数' + ' ( '+items.createNotComeCountYear[yearAA]+' 人 )'
                                    }
                                    return name
                                }
                            },
                            {
                                type: 'scroll',
                                textStyle: {color: '#000'},
                                top: 20,
                                left: 160,
                                itemWidth: 14,
                                pageIconColor: '#b7b7b7',
                                pageIconInactiveColor: '#b7b7b7',
                                pageTextStyle: {
                                    color: '#000'
                                },
                                data: [
                                    {
                                        name: (y-1)+'年新浆员',
                                        icon: 'circle'
                                    },
                                    {
                                        name: (y-1)+'年R浆员',
                                        icon: 'circle'
                                    },
                                    {
                                        name: (y-1)+'年建档未献浆浆员',
                                        icon: 'circle'
                                    },
                                    {
                                        name: (y-1)+'年净增长浆员',
                                        icon: 'circle'
                                    },
                                    {
                                        name: (y-1)+'年淘汰浆员',
                                        icon: 'circle'
                                    },
                                ],
                                selected:selected2,
                                formatter: function (name) {
                                    if (name == (yearA+'年净增长浆员') ) {
                                       name = yearA+'年累积净增长浆员总人数' + ' ( '+items.netBoostCountYear[yearA]+' 人 )'
                                    } else if (name == (yearA+'年淘汰浆员') ) {
                                       name = yearA+'年累积淘汰浆员总人数' + ' ( '+items.outProviderCountYear[yearA]+' 人 )'
                                    } else if (name === (yearA+'年新浆员') ) {
                                      name = yearA+'年累积新浆员总人数' + ' ( '+items.createCountYear[yearA]+' 人 )'
                                    } else if (name == (yearA+'年R浆员') ) {
                                       name = yearA+'年累积R浆员总人数' + ' ( '+items.createRCountYear[yearA]+' 人 )'
                                    } else if (name == (yearA+'年建档未献浆浆员') ) {
                                        name = yearA+'年累积建档未献浆浆员总人数' + ' ( '+items.createNotComeCountYear[yearA]+' 人 )'
                                    }
                                    return name
                                }
                            },
                            {
                                type: 'scroll',
                                textStyle: {color: '#000'},
                                top: 40,
                                left: 160,
                                itemWidth: 14,
                                pageIconColor: '#b7b7b7',
                                pageIconInactiveColor: '#b7b7b7',
                                pageTextStyle: {
                                    color: '#000'
                                },
                                data: [
                                    {
                                        name: y+'年新浆员',
                                        icon: 'circle'
                                    },
                                    {
                                        name: y+'年R浆员',
                                        icon: 'circle'
                                    },
                                    {
                                        name: y+'年建档未献浆浆员',
                                        icon: 'circle'
                                    },
                                    {
                                        name: y+'年净增长浆员',
                                        icon: 'circle'
                                    },
                                    {
                                        name: y+'年淘汰浆员',
                                        icon: 'circle'
                                    }
                                ],
                                selected: selected3,
                                formatter: function (name) {
                                   if (name == (y+'年净增长浆员') ) {
                                       name = y+'年累积净增长浆员总人数' + ' ( '+items.netBoostCountYear[y]+' 人 )'
                                    } else if (name == (y+'年淘汰浆员') ) {
                                       name = y+'年累积淘汰浆员总人数' + ' ( '+items.outProviderCountYear[y]+' 人 )'
                                    } else if (name === (y+'年新浆员') ) {
                                      name = y+'年累积新浆员总人数' + ' ( '+items.createCountYear[y]+' 人 )'
                                    } else if (name == (y+'年R浆员') ) {
                                       name = y+'年累积R浆员总人数' + ' ( '+items.createRCountYear[y]+' 人 )'
                                    } else if (name == (y+'年建档未献浆浆员') ) {
                                        name = y+'年累积建档未献浆浆员总人数' + ' ( '+items.createNotComeCountYear[y]+' 人 )'
                                    }
                                    return name
                                }
                            }
                        ],
                        xAxis: xAxis,
                        yAxis: {
                            type: 'value',
                            nameGap: 5,
                            min: 0,
                            splitLine: {
                                show: false
                            },
                            axisLine: {
                                lineStyle: {
                                    color: '#000'
                                }
                            }
                        },
                        dataZoom: [
                            {
                                type: 'slider',
                                filterMode: 'weakFilter',
                                showDataShadow: true,
                                bottom: 20,
                                height: 5,
                                start: 0,
                                end: dataZoomEnd,
                                borderColor: 'transparent',
                                backgroundColor: '#e2e2e2',
                                handleIcon: 'M10.7,11.9H9.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z',
                                handleSize: 15,
                                handleStyle: {
                                    shadowBlur: 6,
                                    shadowOffsetX: 1,
                                    shadowOffsetY: 2,
                                    shadowColor: '#000'
                                },
                                labelFormatter: ''
                            },
                            {
                                type: 'inside',
                                filterMode: 'weakFilter'
                            }
                        ],
                        series: (function () {
                            var series = [];
                            var data = [
                                {
                                    name: (y-2) + '年新浆员',
                                    value: datas['newP'+yearAA],
                                    stack: (y-2),
                                    color: '#ffA642'
                                },
                                {
                                    name: (y-1)+'年新浆员',
                                    value: datas['newP'+yearA],
                                    stack: (y-1),
                                    color: '#3ea5d4'
                                },
                                {
                                    name: y+'年新浆员',
                                    value: datas['newP'+y],
                                    stack: y,
                                    color: '#AFD44D'
                                },
                                {
                                    name: (y-2)+'年建档未献浆浆员',
                                    value: datas['notP'+yearAA],
                                    stack: (y-2),
                                    color: '#e95e48'
                                },
                                {
                                    name: (y-1)+'年建档未献浆浆员',
                                    value: datas['notP'+yearA],
                                    stack: (y-1),
                                    color: '#e95e48'
                                },
                                {
                                    name: y+'年建档未献浆浆员',
                                    value: datas['notP'+y],
                                    stack: y,
                                    color: '#e95e48'
                                },
                                {
                                    name: (y-2)+'年R浆员',
                                    value: datas['RP'+yearAA],
                                    stack: (y-2),
                                    color: '#DDB100'
                                },
                                {
                                    name: (y-1)+'年R浆员',
                                    value: datas['RP'+yearA],
                                    stack: (y-1),
                                    color: '#DDB100'
                                },
                                {
                                    name: y+'年R浆员',
                                    value: datas['RP'+y],
                                    stack: y,
                                    color: '#DDB100'
                                },
                                {
                                    name: (y-2)+'年净增长浆员',
                                    value: datas['netGrowth'+yearAA],
                                    stack: (y-2) + '月',
                                    color: '#3EA7D5'
                                },
                                {
                                    name: (y-1)+'年净增长浆员',
                                    value: datas['netGrowth'+yearA],
                                    stack: (y-1)+'月',
                                    color: '#455fd8'
                                },
                                {
                                    name: y+'年净增长浆员',
                                    value: datas['netGrowth'+y],
                                    stack: y+'月',
                                    color: '#82c849'
                                },
                                {
                                    name: (y-2)+'年淘汰浆员',
                                    value: datas['outProvider'+yearAA],
                                    stack: (y-2)+'月',
                                    color: '#a67d15'
                                },
                                {
                                    name: (y-1)+'年淘汰浆员',
                                    value: datas['outProvider'+yearA],
                                    stack: (y-1)+'月',
                                    color: '#a67d15'
                                },
                                {
                                    name: y+'年淘汰浆员',
                                    value: datas['outProvider'+y],
                                    stack: y+'月',
                                    color: '#a67d15'
                                }

                            ];
                            for (var i = 0; i < data.length; i++) {
                                var item = data[i];
                                series.push({
                                    name: item.name,
                                    stack: item.stack,
                                    data: item.value,
                                    type: 'bar',
                                    // barWidth: item.stack === '今年月' ? 6 : 12,
                                    barGap: '100%',
                                    itemStyle: {
                                        normal: {
                                            color: item.color
                                        }
                                    }
                                })
                            }
                            return series
                        }())
                    };
                    // let myChart1 =this.$echarts.init(document.querySelectorAll('#XJYTQB')[0]);
                    myChartId.setOption(option1);
                     window.addEventListener("resize", () => {
                        myChartId.resize();
                    });
        },   
        
        // api获取数据
        getPulpWeight(myChartId){
            let that = this
            loadingIn()
            analysisHttp.getPulpWeight().then(res => {
                if(res.statusCode == 200){
                    that.JLTQBdata = res.content
                    that.JLTQB(myChartId)
                }
                loadingClose()
            })
        },
        getFrequencyCount(myChartId){
            let that = this
            loadingIn()
            analysisHttp.getFrequencyCount().then(res => {
                if(res.statusCode == 200){
                    that.FZTQBData = res.content
                    that.FZTQB(myChartId)
                }
                 loadingClose()
            })
        },
        getNewAndOutProviderCount(myChartId){
            let that = this
            loadingIn()
            analysisHttp.getNewAndOutProviderCount().then(res => {
                if(res.statusCode == 200){
                    that.XJYTQBData = res.content
                    that.XJYTQB(myChartId)
                }
                 loadingClose()
            })
        },
        alterData(arr, n) { //重构data数据（数组一维变二维）
            let self = this,
                Arr = arr != null ? arr : [],
                len = Arr.length,
                lineNum = (lineNum =
                    len % n === 0 ? len / n : Math.floor(len / n + 1)),
                res = [];
            for (let i = 0; i < lineNum; i++) {
                let temp = Arr.slice(i * n, i * n + n);
                res.push(temp);
            }
            return res;
        }
    },
  
}
</script>
<style lang="scss">
.echartBox{margin-bottom:10px;}
table.tooltipTable {font-size: 1em;border-collapse: collapse;table-layout: fixed;width: 690px;  th {overflow: hidden;white-space: normal;font-weight: 400;border: 1px solid rgba(0, 0, 0, .2);}
        td {
            padding: 3px 1px;
        }
        th, td {
            text-align: center;
            vertical-align: middle;
            word-wrap: break-word;
            font-size: 12px;
        }
}   
.tooltipP {
    color: #000;
    font-size: 14px;
    line-height: 14px;
    margin: 5px 0 2px;
    text-align: left;
    font-weight: bold;
    padding: 0 0 0 7px;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    border-left: 5px solid #06B7E5;
}

.tooltipTable {width: 100%;table-layout: fixed;}

.tooltipTable,
.tooltipTable td {color: #000;border: 1px solid rgba(0, 0, 0, .2);}

.tooltipTable td.bg_105 > a {
    color: #FFF;
}

.tooltipTable td.bg_f9c > a {
    color: blue;
}

.bg_f9c {
    background: rgba(115, 255, 1, 0.05);
}

.bg_f3d {
    background: #fff3cd5c;
}

.bg_d9e {
    background: rgba(62, 165, 212, 0.11);
}

.bg_d1c {
    background: #d1cfdfde;
}

.bg_105 {
    background: #105055;
    color: #FFF !important;
}

.bg_0ea {
    background: #0ea0da69;
}

.bg_2f9 {
    background: #2f96383d;
}

.bg_ffc {
    background: #ffcc09;
}

.cursor:hover {
    cursor: pointer;
}

.padding_5 {
    padding: 5px 0 !important;
}
.LLYTitle{}
// .v-modal{z-index: 99999999 !important;}
.tqydqjltj .el-dialog__wrapper{z-index: 999999999 !important;}
</style>>
 